package app

import (
	"gorm.io/gorm"
	"time"
)

type SysAdmin struct {
	AdminEmail        string    `gorm:"unique;comment:用户邮箱"`
	AdminPassword     string    `gorm:"unique;comment:用户密码"`
	AdminPasswordSalt string    `gorm:"comment:用户密码盐值"`
	AdminParent       uint      `gorm:"comment:用户父ID"`
	AdminMoney        uint      `gorm:"comment:用户金额"`
	AdminIp           string    `gorm:"comment:用户IP地址"`
	AdminRemark       string    `gorm:"comment:用户备注"`
	AdminExpiration   time.Time `gorm:"comment:用户最后一次修改密码时间"`
	Models
}

// TableName 表名称
func (SysAdmin) TableName() string {
	return "sys_admin"
}

type Models struct {
	gorm.Model
	CreateBy uint
	UpdateBy uint
	DeleteBy uint
	Status   string
}

// SysGift 礼物配置
type SysGift struct {
	GiftName        string `gorm:"unique;comment:礼物名称"`
	GiftID          uint   `gorm:"unique;comment:礼物ID"`
	GiftPrice       uint   `gorm:"comment:礼物价值"`
	GiftIcon        string `gorm:"comment:礼物图标"`
	GiftType        string `gorm:"comment:礼物类型"`
	GiftEncryptedID string `gorm:"comment:礼物加密ID"`
	Models
}

// TableName 礼物配置表
func (SysGift) TableName() string {
	return "sys_gift"
}

// SysApiList API列表
type SysApiList struct {
	ApiPath     string `gorm:"unique;comment:API路径"`
	ApiMethod   string `gorm:"comment:API请求方法"`
	ApiDescribe string `gorm:"comment:API描述"`
	ApiGroup    string `gorm:"comment:API分组"`
	Models
}

// TableName 礼物配置表
func (SysApiList) TableName() string {
	return "sys_api_list"
}

// SysLiveMsg 消息列表
type SysLiveMsg struct {
	LiveType      string `gorm:"comment:直播平台"`
	LiveRoomId    string `gorm:"comment:直播间ID"`
	LiveMsgId     string `gorm:"comment:消息ID"`
	LiveUserName  string `gorm:"comment:用户昵称"`
	LiveUserUid   string `gorm:"comment:用户ID"`
	LiveHeadUrl   string `gorm:"comment:用户头像地址"`
	LiveMessage   string `gorm:"comment:消息内容"`
	LiveGiftName  string `gorm:"comment:礼物名称"`
	LiveGiftNum   uint   `gorm:"comment:礼物数量"`
	LiveGiftPrice uint   `gorm:"comment:礼物总价值"`
	Models
}

// TableName 礼物配置表
func (SysLiveMsg) TableName() string {
	return "sys_live_msg"
}

// SysUserLiveList 主播开播列表
type SysUserLiveList struct {
	UserName string `gorm:"comment:用户昵称"`
	UserId   string `gorm:"comment:用户ID"`
	HeadUrl  string `gorm:"comment:用户头像"`
	RoomCode string `gorm:"comment:直播间ID"`
	Models
}

// TableName 礼物配置表
func (SysUserLiveList) TableName() string {
	return "sys_user_live_list"
}

// SysUserList 消息列表
type SysUserList struct {
	UserName        string `gorm:"unique;comment:用户昵称"`
	UserUid         string `gorm:"comment:用户ID"`
	UserHeadUrl     string `gorm:"comment:用户头像地址"`
	UserGiftPrice   uint   `gorm:"comment:用户总充值金额"`
	UserPoints      uint   `gorm:"comment:用户积分"`
	UserStreakCount uint   `gorm:"comment:用户连胜或连败次数"`
	Models
}

// TableName 礼物配置表
func (SysUserList) TableName() string {
	return "sys_user_list"
}
